#region Using Directives

using System;
using Microsoft.Practices.ComponentModel;
using Microsoft.Practices.RecipeFramework;
using System.IO;
using System.Text;
using System.Diagnostics;

#endregion

namespace EEst.SoftwareFactory.Actions
{
    class CheckContentAction : Action
    {
        #region Input Properties

        [Input]
        public string TextContent
        {
            get { return content; }
            set { content = value; }
        } string content;

        #endregion

        #region Output Properties

        [Output]
        public string Result
        {
            get { return result; }
            set { result = value; }
        } string result;

        #endregion

        #region IAction Members

        public override void Execute()
        {
            Debug.WriteLine("CheckContentAction :");
            Debug.WriteLine("Show TextContent ----------------------------------------------------->");
            TextReader reader = new StringReader(content);
            string line = null;
            do
            {
                line = reader.ReadLine();
                if (line != null)
                {
                    System.Diagnostics.Debug.WriteLine(line);
                }
            } while (line != null);
            Debug.WriteLine("End of TextContent <---------------------------------------------------");
        }

        public override void Undo()
        {
//            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
}
